<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>

    var names = ["abc","cba","nba","mba","why","kobe"]

    // 1.slice方法 不会修改原数组
    var newNames = names.slice(2)
    console.log(newNames)

    // 2.concact   将多个数组拼接
    var names1 = ["abc","cba"]
    var names2 = ["nba","mba"]
    var names3 = ["why","kobe"]
    var newNames1 = names1.concat(names2,names3)
    console.log(newNames1)

    //3.join 
    var jName = newNames1.join(",")
    console.log(jName)
  </script>
</body>
</html>